﻿using System;
using HslCommunication.Profinet.Melsec;
using HslCommunication.Profinet.Panasonic;

namespace HslCommunication.Core.Address
{
	/// <summary>
	/// 三菱的数据地址表示形式<br />
	/// Mitsubishi's data address representation
	/// </summary>
	// Token: 0x0200016A RID: 362
	public class McAddressData : DeviceAddressDataBase
	{
		/// <summary>
		/// 实例化一个默认的对象
		/// </summary>
		// Token: 0x06001DF3 RID: 7667 RVA: 0x0008E87F File Offset: 0x0008CA7F
		public McAddressData()
		{
			this.McDataType = MelsecMcDataType.D;
		}

		/// <summary>
		/// 三菱的数据类型及地址信息
		/// </summary>
		// Token: 0x1700061B RID: 1563
		// (get) Token: 0x06001DF4 RID: 7668 RVA: 0x0008E895 File Offset: 0x0008CA95
		// (set) Token: 0x06001DF5 RID: 7669 RVA: 0x0008E89D File Offset: 0x0008CA9D
		public MelsecMcDataType McDataType { get; set; }

		/// <summary>
		/// 从指定的地址信息解析成真正的设备地址信息，默认是三菱的地址
		/// </summary>
		/// <param name="address">地址信息</param>
		/// <param name="length">数据长度</param>
		// Token: 0x06001DF6 RID: 7670 RVA: 0x0008E8A8 File Offset: 0x0008CAA8
		public override void Parse(string address, ushort length)
		{
			OperateResult<McAddressData> operateResult = McAddressData.ParseMelsecFrom(address, length);
			bool isSuccess = operateResult.IsSuccess;
			if (isSuccess)
			{
				base.AddressStart = operateResult.Content.AddressStart;
				base.Length = operateResult.Content.Length;
				this.McDataType = operateResult.Content.McDataType;
			}
		}

		/// <inheritdoc />
		// Token: 0x06001DF7 RID: 7671 RVA: 0x0008E900 File Offset: 0x0008CB00
		public override string ToString()
		{
			return this.McDataType.AsciiCode.Replace("*", "") + Convert.ToString(base.AddressStart, this.McDataType.FromBase);
		}

		/// <summary>
		/// 从实际三菱的地址里面解析出我们需要的地址类型<br />
		/// Resolve the type of address we need from the actual Mitsubishi address
		/// </summary>
		/// <param name="address">三菱的地址数据信息</param>
		/// <param name="length">读取的数据长度</param>
		/// <returns>是否成功的结果对象</returns>
		// Token: 0x06001DF8 RID: 7672 RVA: 0x0008E938 File Offset: 0x0008CB38
		public static OperateResult<McAddressData> ParseMelsecFrom(string address, ushort length)
		{
			McAddressData mcAddressData = new McAddressData();
			mcAddressData.Length = length;
			try
			{
				char c = address[0];
				char c2 = c;
				switch (c2)
				{
				case 'B':
					goto IL_39E;
				case 'C':
					goto IL_7CA;
				case 'D':
					goto IL_1CE;
				case 'E':
				case 'G':
				case 'H':
				case 'I':
				case 'J':
				case 'K':
				case 'N':
				case 'O':
				case 'P':
				case 'Q':
				case 'U':
					goto IL_8C0;
				case 'F':
					goto IL_340;
				case 'L':
					goto IL_311;
				case 'M':
					break;
				case 'R':
					goto IL_3CD;
				case 'S':
					goto IL_3FC;
				case 'T':
					goto IL_6CE;
				case 'V':
					goto IL_36F;
				case 'W':
					goto IL_2E2;
				case 'X':
					goto IL_12A;
				case 'Y':
					goto IL_17B;
				case 'Z':
					goto IL_64E;
				default:
					switch (c2)
					{
					case 'b':
						goto IL_39E;
					case 'c':
						goto IL_7CA;
					case 'd':
						goto IL_1CE;
					case 'e':
					case 'g':
					case 'h':
					case 'i':
					case 'j':
					case 'k':
					case 'n':
					case 'o':
					case 'p':
					case 'q':
					case 'u':
						goto IL_8C0;
					case 'f':
						goto IL_340;
					case 'l':
						goto IL_311;
					case 'm':
						break;
					case 'r':
						goto IL_3CD;
					case 's':
						goto IL_3FC;
					case 't':
						goto IL_6CE;
					case 'v':
						goto IL_36F;
					case 'w':
						goto IL_2E2;
					case 'x':
						goto IL_12A;
					case 'y':
						goto IL_17B;
					case 'z':
						goto IL_64E;
					default:
						goto IL_8C0;
					}
					break;
				}
				mcAddressData.McDataType = MelsecMcDataType.M;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.M.FromBase);
				goto IL_8D0;
				IL_12A:
				mcAddressData.McDataType = MelsecMcDataType.X;
				address = address.Substring(1);
				bool flag = address.StartsWith("0");
				if (flag)
				{
					mcAddressData.AddressStart = Convert.ToInt32(address, 8);
				}
				else
				{
					mcAddressData.AddressStart = Convert.ToInt32(address, MelsecMcDataType.X.FromBase);
				}
				goto IL_8D0;
				IL_17B:
				mcAddressData.McDataType = MelsecMcDataType.Y;
				address = address.Substring(1);
				bool flag2 = address.StartsWith("0");
				if (flag2)
				{
					mcAddressData.AddressStart = Convert.ToInt32(address, 8);
				}
				else
				{
					mcAddressData.AddressStart = Convert.ToInt32(address, MelsecMcDataType.Y.FromBase);
				}
				goto IL_8D0;
				IL_1CE:
				bool flag3 = address[1] == 'X' || address[1] == 'x';
				if (flag3)
				{
					mcAddressData.McDataType = MelsecMcDataType.DX;
					address = address.Substring(2);
					bool flag4 = address.StartsWith("0");
					if (flag4)
					{
						mcAddressData.AddressStart = Convert.ToInt32(address, 8);
					}
					else
					{
						mcAddressData.AddressStart = Convert.ToInt32(address, MelsecMcDataType.DX.FromBase);
					}
					goto IL_8D0;
				}
				bool flag5 = address[1] == 'Y' || address[1] == 's';
				if (flag5)
				{
					mcAddressData.McDataType = MelsecMcDataType.DY;
					address = address.Substring(2);
					bool flag6 = address.StartsWith("0");
					if (flag6)
					{
						mcAddressData.AddressStart = Convert.ToInt32(address, 8);
					}
					else
					{
						mcAddressData.AddressStart = Convert.ToInt32(address, MelsecMcDataType.DY.FromBase);
					}
					goto IL_8D0;
				}
				mcAddressData.McDataType = MelsecMcDataType.D;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.D.FromBase);
				goto IL_8D0;
				IL_2E2:
				mcAddressData.McDataType = MelsecMcDataType.W;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.W.FromBase);
				goto IL_8D0;
				IL_311:
				mcAddressData.McDataType = MelsecMcDataType.L;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.L.FromBase);
				goto IL_8D0;
				IL_340:
				mcAddressData.McDataType = MelsecMcDataType.F;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.F.FromBase);
				goto IL_8D0;
				IL_36F:
				mcAddressData.McDataType = MelsecMcDataType.V;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.V.FromBase);
				goto IL_8D0;
				IL_39E:
				mcAddressData.McDataType = MelsecMcDataType.B;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.B.FromBase);
				goto IL_8D0;
				IL_3CD:
				mcAddressData.McDataType = MelsecMcDataType.R;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.R.FromBase);
				goto IL_8D0;
				IL_3FC:
				bool flag7 = address[1] == 'N' || address[1] == 'n';
				if (flag7)
				{
					mcAddressData.McDataType = MelsecMcDataType.SN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SN.FromBase);
					goto IL_8D0;
				}
				bool flag8 = address[1] == 'S' || address[1] == 's';
				if (flag8)
				{
					mcAddressData.McDataType = MelsecMcDataType.SS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SS.FromBase);
					goto IL_8D0;
				}
				bool flag9 = address[1] == 'C' || address[1] == 'c';
				if (flag9)
				{
					mcAddressData.McDataType = MelsecMcDataType.SC;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SC.FromBase);
					goto IL_8D0;
				}
				bool flag10 = address[1] == 'M' || address[1] == 'm';
				if (flag10)
				{
					mcAddressData.McDataType = MelsecMcDataType.SM;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SM.FromBase);
					goto IL_8D0;
				}
				bool flag11 = address[1] == 'D' || address[1] == 'd';
				if (flag11)
				{
					mcAddressData.McDataType = MelsecMcDataType.SD;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SD.FromBase);
					goto IL_8D0;
				}
				bool flag12 = address[1] == 'B' || address[1] == 'b';
				if (flag12)
				{
					mcAddressData.McDataType = MelsecMcDataType.SB;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SB.FromBase);
					goto IL_8D0;
				}
				bool flag13 = address[1] == 'W' || address[1] == 'w';
				if (flag13)
				{
					mcAddressData.McDataType = MelsecMcDataType.SW;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.SW.FromBase);
					goto IL_8D0;
				}
				mcAddressData.McDataType = MelsecMcDataType.S;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.S.FromBase);
				goto IL_8D0;
				IL_64E:
				bool flag14 = address.StartsWith("ZR") || address.StartsWith("zr");
				if (flag14)
				{
					mcAddressData.McDataType = MelsecMcDataType.ZR;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.ZR.FromBase);
					goto IL_8D0;
				}
				mcAddressData.McDataType = MelsecMcDataType.Z;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Z.FromBase);
				goto IL_8D0;
				IL_6CE:
				bool flag15 = address[1] == 'N' || address[1] == 'n';
				if (flag15)
				{
					mcAddressData.McDataType = MelsecMcDataType.TN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.TN.FromBase);
					goto IL_8D0;
				}
				bool flag16 = address[1] == 'S' || address[1] == 's';
				if (flag16)
				{
					mcAddressData.McDataType = MelsecMcDataType.TS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.TS.FromBase);
					goto IL_8D0;
				}
				bool flag17 = address[1] == 'C' || address[1] == 'c';
				if (flag17)
				{
					mcAddressData.McDataType = MelsecMcDataType.TC;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.TC.FromBase);
					goto IL_8D0;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_7CA:
				bool flag18 = address[1] == 'N' || address[1] == 'n';
				if (flag18)
				{
					mcAddressData.McDataType = MelsecMcDataType.CN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.CN.FromBase);
					goto IL_8D0;
				}
				bool flag19 = address[1] == 'S' || address[1] == 's';
				if (flag19)
				{
					mcAddressData.McDataType = MelsecMcDataType.CS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.CS.FromBase);
					goto IL_8D0;
				}
				bool flag20 = address[1] == 'C' || address[1] == 'c';
				if (flag20)
				{
					mcAddressData.McDataType = MelsecMcDataType.CC;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.CC.FromBase);
					goto IL_8D0;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_8C0:
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_8D0:;
			}
			catch (Exception ex)
			{
				return new OperateResult<McAddressData>(ex.Message);
			}
			return OperateResult.CreateSuccessResult<McAddressData>(mcAddressData);
		}

		/// <summary>
		/// 从实际基恩士的地址里面解析出我们需要的地址信息<br />
		/// Resolve the address information we need from the actual Keyence address
		/// </summary>
		/// <param name="address">基恩士的地址数据信息</param>
		/// <param name="length">读取的数据长度</param>
		/// <returns>是否成功的结果对象</returns>
		// Token: 0x06001DF9 RID: 7673 RVA: 0x0008F254 File Offset: 0x0008D454
		public static OperateResult<McAddressData> ParseKeyenceFrom(string address, ushort length)
		{
			McAddressData mcAddressData = new McAddressData();
			mcAddressData.Length = length;
			try
			{
				char c = address[0];
				char c2 = c;
				if (c2 <= 'Z')
				{
					switch (c2)
					{
					case 'B':
						goto IL_16E;
					case 'C':
						goto IL_461;
					case 'D':
						goto IL_278;
					default:
						switch (c2)
						{
						case 'L':
							goto IL_19D;
						case 'M':
							break;
						case 'N':
						case 'O':
						case 'P':
						case 'Q':
						case 'U':
						case 'V':
							goto IL_557;
						case 'R':
							goto IL_2A7;
						case 'S':
							goto IL_1CC;
						case 'T':
							goto IL_365;
						case 'W':
							goto IL_336;
						case 'X':
							goto IL_110;
						case 'Y':
							goto IL_13F;
						case 'Z':
							goto IL_2D6;
						default:
							goto IL_557;
						}
						break;
					}
				}
				else
				{
					switch (c2)
					{
					case 'b':
						goto IL_16E;
					case 'c':
						goto IL_461;
					case 'd':
						goto IL_278;
					default:
						switch (c2)
						{
						case 'l':
							goto IL_19D;
						case 'm':
							break;
						case 'n':
						case 'o':
						case 'p':
						case 'q':
						case 'u':
						case 'v':
							goto IL_557;
						case 'r':
							goto IL_2A7;
						case 's':
							goto IL_1CC;
						case 't':
							goto IL_365;
						case 'w':
							goto IL_336;
						case 'x':
							goto IL_110;
						case 'y':
							goto IL_13F;
						case 'z':
							goto IL_2D6;
						default:
							goto IL_557;
						}
						break;
					}
				}
				mcAddressData.McDataType = MelsecMcDataType.Keyence_M;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_M.FromBase);
				goto IL_567;
				IL_110:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_X;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_X.FromBase);
				goto IL_567;
				IL_13F:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_Y;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_Y.FromBase);
				goto IL_567;
				IL_16E:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_B;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_B.FromBase);
				goto IL_567;
				IL_19D:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_L;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_L.FromBase);
				goto IL_567;
				IL_1CC:
				bool flag = address[1] == 'M' || address[1] == 'm';
				if (flag)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_SM;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_SM.FromBase);
					goto IL_567;
				}
				bool flag2 = address[1] == 'D' || address[1] == 'd';
				if (flag2)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_SD;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_SD.FromBase);
					goto IL_567;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_278:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_D;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_D.FromBase);
				goto IL_567;
				IL_2A7:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_R;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_R.FromBase);
				goto IL_567;
				IL_2D6:
				bool flag3 = address[1] == 'R' || address[1] == 'r';
				if (flag3)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_ZR;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_ZR.FromBase);
					goto IL_567;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_336:
				mcAddressData.McDataType = MelsecMcDataType.Keyence_W;
				mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1), MelsecMcDataType.Keyence_W.FromBase);
				goto IL_567;
				IL_365:
				bool flag4 = address[1] == 'N' || address[1] == 'n';
				if (flag4)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_TN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_TN.FromBase);
					goto IL_567;
				}
				bool flag5 = address[1] == 'S' || address[1] == 's';
				if (flag5)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_TS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_TS.FromBase);
					goto IL_567;
				}
				bool flag6 = address[1] == 'C' || address[1] == 'c';
				if (flag6)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_TC;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_TC.FromBase);
					goto IL_567;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_461:
				bool flag7 = address[1] == 'N' || address[1] == 'n';
				if (flag7)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_CN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_CN.FromBase);
					goto IL_567;
				}
				bool flag8 = address[1] == 'S' || address[1] == 's';
				if (flag8)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_CS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_CS.FromBase);
					goto IL_567;
				}
				bool flag9 = address[1] == 'C' || address[1] == 'c';
				if (flag9)
				{
					mcAddressData.McDataType = MelsecMcDataType.Keyence_CC;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2), MelsecMcDataType.Keyence_CC.FromBase);
					goto IL_567;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_557:
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_567:;
			}
			catch (Exception ex)
			{
				return new OperateResult<McAddressData>(ex.Message);
			}
			return OperateResult.CreateSuccessResult<McAddressData>(mcAddressData);
		}

		/// <summary>
		/// 从实际松下的地址里面解析出
		/// </summary>
		/// <param name="address">松下的地址数据信息</param>
		/// <param name="length">读取的数据长度</param>
		/// <returns>是否成功的结果对象</returns>
		// Token: 0x06001DFA RID: 7674 RVA: 0x0008F808 File Offset: 0x0008DA08
		public static OperateResult<McAddressData> ParsePanasonicFrom(string address, ushort length)
		{
			McAddressData mcAddressData = new McAddressData();
			mcAddressData.Length = length;
			try
			{
				char c = address[0];
				char c2 = c;
				if (c2 <= 'Y')
				{
					if (c2 <= 'L')
					{
						if (c2 == 'C')
						{
							goto IL_2D6;
						}
						if (c2 == 'D')
						{
							goto IL_1CF;
						}
						if (c2 != 'L')
						{
							goto IL_36A;
						}
						goto IL_164;
					}
					else if (c2 <= 'T')
					{
						if (c2 != 'R')
						{
							if (c2 != 'T')
							{
								goto IL_36A;
							}
							goto IL_23C;
						}
					}
					else
					{
						if (c2 == 'X')
						{
							goto IL_11A;
						}
						if (c2 != 'Y')
						{
							goto IL_36A;
						}
						goto IL_13F;
					}
				}
				else if (c2 <= 'l')
				{
					if (c2 == 'c')
					{
						goto IL_2D6;
					}
					if (c2 == 'd')
					{
						goto IL_1CF;
					}
					if (c2 != 'l')
					{
						goto IL_36A;
					}
					goto IL_164;
				}
				else if (c2 <= 't')
				{
					if (c2 != 'r')
					{
						if (c2 != 't')
						{
							goto IL_36A;
						}
						goto IL_23C;
					}
				}
				else
				{
					if (c2 == 'x')
					{
						goto IL_11A;
					}
					if (c2 != 'y')
					{
						goto IL_36A;
					}
					goto IL_13F;
				}
				int num = PanasonicHelper.CalculateComplexAddress(address.Substring(1));
				bool flag = num < 14400;
				if (flag)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_R;
					mcAddressData.AddressStart = num;
				}
				else
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_SM;
					mcAddressData.AddressStart = num - 14400;
				}
				goto IL_37A;
				IL_11A:
				mcAddressData.McDataType = MelsecMcDataType.Panasonic_X;
				mcAddressData.AddressStart = PanasonicHelper.CalculateComplexAddress(address.Substring(1));
				goto IL_37A;
				IL_13F:
				mcAddressData.McDataType = MelsecMcDataType.Panasonic_Y;
				mcAddressData.AddressStart = PanasonicHelper.CalculateComplexAddress(address.Substring(1));
				goto IL_37A;
				IL_164:
				bool flag2 = address[1] == 'D' || address[1] == 'd';
				if (flag2)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_LD;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2));
					goto IL_37A;
				}
				mcAddressData.McDataType = MelsecMcDataType.Panasonic_L;
				mcAddressData.AddressStart = PanasonicHelper.CalculateComplexAddress(address.Substring(1));
				goto IL_37A;
				IL_1CF:
				int num2 = Convert.ToInt32(address.Substring(1));
				bool flag3 = num2 < 90000;
				if (flag3)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_DT;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1));
				}
				else
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_SD;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(1)) - 90000;
				}
				goto IL_37A;
				IL_23C:
				bool flag4 = address[1] == 'N' || address[1] == 'n';
				if (flag4)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_TN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2));
					goto IL_37A;
				}
				bool flag5 = address[1] == 'S' || address[1] == 's';
				if (flag5)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_TS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2));
					goto IL_37A;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_2D6:
				bool flag6 = address[1] == 'N' || address[1] == 'n';
				if (flag6)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_CN;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2));
					goto IL_37A;
				}
				bool flag7 = address[1] == 'S' || address[1] == 's';
				if (flag7)
				{
					mcAddressData.McDataType = MelsecMcDataType.Panasonic_CS;
					mcAddressData.AddressStart = Convert.ToInt32(address.Substring(2));
					goto IL_37A;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_36A:
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_37A:;
			}
			catch (Exception ex)
			{
				return new OperateResult<McAddressData>(ex.Message);
			}
			return OperateResult.CreateSuccessResult<McAddressData>(mcAddressData);
		}
	}
}
